
function bulidTreeLoader(url){
	return new Ext.tree.TreeLoader({
		//dataUrl : '../district/buildTreeDistrictJSON.action?level=4&districtCode='+sys_district_default
		dataUrl :url
	});
}

function bulidTreeCombo(treeRenderId,defaultValue,emptyValue,tree){
	var combo = new Ext.form.ComboBox({
		store : new Ext.data.SimpleStore({
			fields : [],
			data : [[]]
		}),
		editable : false,
		mode : 'local',
		triggerAction : 'all',
		maxHeight : 200,
		width : 200,
		tpl : " <div style='height:200px'><div id='"+treeRenderId+"'></div></div> ",
		selectedClass : '',
		onSelect : Ext.emptyFn,
		value : defaultValue,
		//emptyText : '请选择辖区...'
		emptyText : emptyValue
	});
	combo.on('expand', function() {
		tree.render(treeRenderId);
		tree.getRootNode().expand(false, true, function() {
			if (tree.getRootNode().firstChild) {
				tree.getRootNode().firstChild.expand(false, true);
			}
		});
	});
	return combo;
}

function bulidTree(treeLoad){
	return new Ext.tree.TreePanel({
		loader : treeLoad,
		border : false,
		rootVisible : false,
		root : new Ext.tree.AsyncTreeNode({
			text : '根目录',
			id : '0'
		})
	});
}

function bulidTreeByUri(uri){
	return new Ext.tree.TreePanel({
		loader : new Ext.tree.TreeLoader({
			dataUrl :uri
		}),
		border : false,
		rootVisible : false,
		root : new Ext.tree.AsyncTreeNode({
			text : '根目录',
			id : '0'
		})
	});
}